package router

import (
	"fmt"
	"github.com/gin-gonic/gin"
	"strings"
)

// loginCheck 到时候--追加命令参数--设置密码的功能
func loginCheck(c *gin.Context) {
	ans := c.Query("ans")
	fmt.Println(ans)
	if strings.Contains(ans, "ainiyiwangnian") {
		c.JSON(200, gin.H{
			"pass": 1,
		})
	} else {
		c.JSON(200, gin.H{
			"pass": 0,
		})
	}
	c.Next()
	//unicode.ToUpper('-')
}

func InitMana(c *gin.Engine) {
	g := c.Group("/manage")
	g.POST("/login", loginCheck)
}
